package sdau.hjk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import sdau.hjk.entity.Major;
import sdau.hjk.service.Impl.MajorService;

import java.util.List;

/**
 *@version 1.0
 *@author: huangjiakai
 *@create:2021−04-22 15:39
 *@className:sdau.hjk.controller.MajorController
 *@description: TODO
 */
@Controller
@RequestMapping("/major")
public class MajorController {
    @Autowired
    private MajorService majorService;

    @RequestMapping("/findAll")
    @ResponseBody
    public List<Major> findAll(){
        return majorService.findAll();
    }

    @RequestMapping("/findMajor")
    @ResponseBody
    public List<String> findMajor(){
        return majorService.findMajor();
    }

    @RequestMapping("/findGrade")
    @ResponseBody
    public List<String> findGrade(){
        return majorService.findGrade();
    }

    @RequestMapping("/saveMajor")
    public void saveMajor(Major major){
        majorService.saveMajor(major);
    }

    @RequestMapping("/deleteMajor")
    public void deleteMajor(Major major){
        majorService.deleteMajor(major);
    }
}
